﻿using System.Data;
using System.Data.SqlClient;
using System.ServiceModel;

namespace BLL
{
    //把类定义成服务协定
    [ServiceContract]
    public class WDLogin
    {
        //实例化数据层
        DAL.DALMethod myDAL = new DAL.DALMethod();
        //指示方法定义一个操作协定
        [OperationContract]
        public DataSet btnLogin_Click_CheckLogin(string strAccounts,string strPassword)
        {
            //声明对象数组
            SqlParameter[] param =
            {
                new SqlParameter("@type",SqlDbType.VarChar),
                new SqlParameter("@operatorAccounts",SqlDbType.VarChar),
                new SqlParameter("@operatorPassword",SqlDbType.VarChar),
            };
            //给对象数组赋值
            param[0].Value = "btnLogin_Click_CheckLogin";
            param[1].Value = strAccounts;
            param[2].Value = strPassword;
            //查询数据缓存
            return myDAL.QueryDataSet("WDLogin", param);

        }

    }
}
